:root {
    --primary-color: #165DFF;
    --secondary-color: #0E2E91;
    --text-color: #333;
    --light-bg: #F5F7FA;
    --border-color: #E4E7ED;
    --hover-bg: #E8F3FF;
    --active-bg: #D6E7FF;
    --sidebar-width: 220px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #F5F7FA;
    color: var(--text-color);
    line-height: 1.5;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background-color: #fff;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header .left {
    display: flex;
    align-items: center;
}

.header .left img {
    height: 36px;
    margin-right: 12px;
}

.header .left h3 {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}

.header .right ul {
    list-style: none;
    display: flex;
    align-items: center;
}

.header .right ul li {
    margin-left: 20px;
    position: relative;
}

.header .right ul li a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.header .right ul li a:hover {
    background-color: var(--hover-bg);
}

.header .right ul li img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: var(--primary-color);
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: #fff;
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    transition: width 0.3s;
}

.sidebar ul {
    list-style: none;
}

.sidebar > ul > li > span {
    display: block;
    padding: 12px 20px;
    color: #606266;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.sidebar > ul > li > span:hover {
    background-color: var(--light-bg);
}

.sidebar > ul > li > span::after {
    content: '\f107';
    font-family: 'FontAwesome';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s;
}

.sidebar > ul > li.active > span::after {
    transform: translateY(-50%) rotate(180deg);
}

.sidebar > ul > li > ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.sidebar > ul > li.active > ul {
    max-height: 500px;
    transition: max-height 0.3s ease-in;
}

.sidebar > ul > li > ul > li > a {
    display: block;
    padding: 10px 20px 10px 40px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
    position: relative;
    cursor: pointer; /* 添加点击手势 */
}

.sidebar > ul > li > ul > li > a:hover {
    background-color: var(--hover-bg);
    color: var(--primary-color);
}

.sidebar > ul > li > ul > li > a.active {
    background-color: var(--active-bg);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar > ul > li > ul > li > a::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #C0C4CC;
    transition: background-color 0.3s;
}

.sidebar > ul > li > ul > li > a.active::before {
    background-color: var(--primary-color);
}

/* 主内容区样式 */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 20px;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s, width 0.3s;
}

.content-page {
    display: none; /* 内容页面默认隐藏 */
    animation: fadeIn 0.5s ease-in-out;
}

.content-page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.content-header h2 {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-color);
}

.content-header .breadcrumb {
    font-size: 14px;
    color: #606266;
}

.content-header .breadcrumb a {
    color: #606266;
    text-decoration: none;
}

.content-header .breadcrumb a:hover {
    color: var(--primary-color);
}

.content-header .breadcrumb span {
    margin: 0 8px;
}

/* 卡片样式 */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.card .card-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.card .card-header .icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.card .card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card .card-body .value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-color);
}

.card .card-body .change {
    font-size: 14px;
    color: #67C23A;
    display: flex;
    align-items: center;
}

.card .card-body .change i {
    margin-right: 4px;
}

.card .card-body .change.down {
    color: #F56C6C;
}

/* 图表样式 */
.charts {
    display: grid;
    grid-template-columns: 1fr; /* 改为单栏布局 */
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 15px;
}

.chart-container {
    height: 300px;
}

/* 表格样式 */
.table-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.table-header .search {
    position: relative;
}

.table-header .search input {
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    width: 240px;
    outline: none;
    transition: border-color 0.3s;
}

.table-header .search input:focus {
    border-color: var(--primary-color);
}

.table-header .search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #C0C4CC;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--light-bg);
    font-weight: 500;
    color: #606266;
    text-transform: uppercase;
    font-size: 13px;
}

.data-table td {
    font-size: 14px;
    color: var(--text-color);
}

.data-table tr:hover {
    background-color: var(--hover-bg);
}

.data-table .status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.data-table .status.active {
    background-color: #E6FFFB;
    color: #36CFC9;
}

.data-table .status.inactive {
    background-color: #FDE2E2;
    color: #F56C6C;
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

.data-table .actions button {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s;
}

.data-table .actions button:hover {
    color: var(--secondary-color);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.pagination ul {
    list-style: none;
    display: flex;
    gap: 4px;
}

.pagination ul li a {
    display: block;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

.pagination ul li a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination ul li a.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        left: -220px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .table-header .search input {
        width: 100%;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 操作提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background-color: #333;
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #67C23A;
}

.toast.error {
    background-color: #F56C6C;
}

.toast.warning {
    background-color: #E6A23C;
}

.toast.info {
    background-color: #909399;
}

/* 编辑弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-50px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
}

.modal-header .close {
    color: #909399;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-header .close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #606266;
}

.form-group input, 
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus, 
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group .form-file {
    position: relative;
    display: inline-block;
}

.form-group .form-file input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.form-group .form-file-label {
    display: inline-block;
    padding: 10px 15px;
    background-color: #F5F7FA;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.form-group .form-file-label:hover {
    background-color: var(--hover-bg);
    border-color: var(--primary-color);
}

.form-group .form-file-preview {
    margin-top: 10px;
    display: block;
    max-width: 100%;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 5px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-footer .cancel {
    background-color: #F5F7FA;
    color: var(--text-color);
}

.modal-footer .cancel:hover {
    background-color: var(--hover-bg);
}

.modal-footer .save {
    background-color: var(--primary-color);
    color: #fff;
}

.modal-footer .save:hover {
    background-color: var(--secondary-color);
}

/* 删除确认弹窗样式 */
.delete-modal .modal-content {
    max-width: 400px;
}

.delete-modal .modal-body {
    text-align: center;
}

.delete-modal .modal-body i {
    font-size: 48px;
    color: #F56C6C;
    margin-bottom: 20px;
    display: block;
}

.delete-modal .modal-body p {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 20px;
}

.delete-modal .modal-body p strong {
    color: #F56C6C;
}